package com.cheng.example.atguigu.design_pattern.decorator;

/*
 * @author 程帅
 * @createTime: 2020/10/17 18:24
 * @Created: with IntelliJ IDEA.
 */
public class Client {

    public static void main(String[] args) {

        //1、点一份LongBlack
        Drink order = new LongBlack();
        System.out.println("费用1=" + order.cost());
        System.out.println("描述=" + order.getDes());

        //2、order 加入一份牛奶
        order = new Milk(order);
        System.out.println("order 加入一份牛奶 费用=" + order.cost());
        System.out.println("order 加入一份牛奶 描述=" + order.getDes());

        //3、order 加入一份巧克力
        order = new Chocolate(order);
        System.out.println("order 加入一份巧克力 费用=" + order.cost());
        System.out.println("order 加入一份巧克力 描述=" + order.getDes());

        //4、order 加入一份牛奶
        order = new Milk(order);
        System.out.println("order 加入一份牛奶 费用=" + order.cost());
        System.out.println("order 加入一份牛奶 描述=" + order.getDes());

    }
}
